package com.jt.web.controller;

import com.jt.pojo.Item;
import com.jt.pojo.ItemDesc;
import com.jt.pojo.ItemParam;
import com.jt.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dc
 * @Classname WebItemController
 * @Date 2020/2/22 17:42
 */
@RestController
@RequestMapping("/web/item")
public class WebItemController {

    @Autowired
    private ItemService itemService;

    /***
     * httpclient调用查询商品信息
     * @param itemId 商品id
     * @return
     */
    @RequestMapping("/findItemById")
    public Item findItemById(Long itemId){
        return itemService.findItemById(itemId);
    }

    /**
     * httpClient调用查询商品描述信息
     * @param itemId 商品id
     * @return
     */
    @RequestMapping("/findItemDescById")
    public ItemDesc findItemDescById(Long itemId){
        return itemService.findItemDescById(itemId);
    }

    @RequestMapping("/findItemParamById")
    public ItemParam findItemParamById(Long itemId){
        return itemService.findItemParamById(itemId);
    }

}
